using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio.Modeling.Diagrams;

namespace Guava.ChannelTransformations
{
    public partial class ChannelLane
    {
        public override BoundsRules BoundsRules
        {
            get
            {
                return new MySwimLaneBoundRules();
            }
        }
    }

    public class MySwimLaneBoundRules : BoundsRules
    {
        public override RectangleD GetCompliantBounds(ShapeElement shape, RectangleD proposedBounds)
        {

            RectangleD current = shape.BoundingBox;
            RectangleD rd = new RectangleD(proposedBounds.X, proposedBounds.Y, 5, proposedBounds.Height);

             return rd;

        }
    }




    public partial class VSplitShape
    {
        public override BoundsRules BoundsRules
        {
            get
            {
                return new ShapeBoundRules();
            }
        }
    }
    public partial class HSplitShape
    {
        public override BoundsRules BoundsRules
        {
            get
            {
                return new ShapeBoundRules();
            }
        }
    }
    public partial class ApplyShape
    {
        public override BoundsRules BoundsRules
        {
            get
            {
                return new ShapeBoundRules();
            }
        }
    }
    public partial class AuditShape
    {
        public override BoundsRules BoundsRules
        {
            get
            {
                return new ShapeBoundRules();
            }
        }
    }
    public partial class VMergeShape
    {
        public override BoundsRules BoundsRules
        {
            get
            {
                return new ShapeBoundRules();
            }
        }
    }
    public partial class HMergeShape
    {
        public override BoundsRules BoundsRules
        {
            get
            {
                return new ShapeBoundRules();
            }
        }
    }

    public partial class RenameColumnShape
    {
        public override BoundsRules BoundsRules
        {
            get
            {
                return new ShapeBoundRules();
            }
        }
    }
    public partial class PivotShape
    {
        public override BoundsRules BoundsRules
        {
            get
            {
                return new ShapeBoundRules();
            }
        }
    }
    public partial class UnpivotShape
    {
        public override BoundsRules BoundsRules
        {
            get
            {
                return new ShapeBoundRules();
            }
        }
    }
    public partial class StartShape
    {
        public override BoundsRules BoundsRules
        {
            get
            {
                return new StartShapeBoundRules();
            }
        }
    }
    public partial class EndShape
    {
        public override BoundsRules BoundsRules
        {
            get
            {
                return new EndShapeBoundRules();
            }
        }
    }
    public class StartShapeBoundRules : BoundsRules
    {
        public override RectangleD GetCompliantBounds(ShapeElement shape, RectangleD proposedBounds)
        {

            RectangleD current = shape.BoundingBox;
            RectangleD rd = new RectangleD(1, 1, proposedBounds.Width, proposedBounds.Height);

            return rd;

        }
    }
    public class EndShapeBoundRules : BoundsRules
    {
        public override RectangleD GetCompliantBounds(ShapeElement shape, RectangleD proposedBounds)
        {
            RectangleD current = shape.BoundingBox;
            RectangleD rd = new RectangleD(1, proposedBounds.Y, proposedBounds.Width, proposedBounds.Height);
            if (proposedBounds.Y < 1)
                rd.Y = proposedBounds.Y + 5;


            return rd;

        }
    }
    public class ShapeBoundRules : BoundsRules
    {

        public override RectangleD GetCompliantBounds(ShapeElement shape, RectangleD proposedBounds)
        {

            RectangleD current = shape.BoundingBox;
            RectangleD rd = new RectangleD(2, proposedBounds.Y, proposedBounds.Width, proposedBounds.Height);

            return rd;

        }
    }


}
